package org.example.day02;

/**
 * 第一章节1.10.1：优先级的继承特性
 *      默认情况下线程的优先级为5。 MIN_PRIORITY = 1,NORM_PRIORITY = 5,MAX_PRIORITY = 10
 */
public class MyThread5 extends Thread{
    @Override
    public void run() {
        System.out.println("MyThread5 priority = " + this.getPriority());
        MyThread6 m6 = new MyThread6();
        m6.start();
    }

    public static void main(String[] args) {
        System.out.println("Main begin priority = " + Thread.currentThread().getPriority());
//        Thread.currentThread().setPriority(6);
//        System.out.println("Main end priority = " + Thread.currentThread().getPriority());
        MyThread5 m5 = new MyThread5();
        m5.start();
    }
}

class MyThread6 extends Thread{
    @Override
    public void run() {
        System.out.println("MyThread6 priority = " + this.getPriority());
    }
}